import csv
from faker import Faker

fake = Faker('zh_CN')

# 生成数据
data = []
for i in range(500):
    name = fake.name()
    id_number = fake.ssn()
    phone_number = fake.phone_number()
    email = fake.email(domain='qq.com')
    data.append([i+7, name, id_number, '666666', phone_number, email, '100'])


# 写入CSV文件
with open('data_info.csv', 'w', newline='', encoding='utf-8') as file:
    writer = csv.writer(file)
    writer.writerows(data)

print('数据已保存到data_info.csv文件中')
